package com.zhu.transaction.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author zhu
 * @since 2021-01-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ToString
@ApiModel(value = "TProduct对象", description = "")
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    private String id;

    @ApiModelProperty(value = "商品名")
    private String name;

    @ApiModelProperty(value = "商品描述")
    private String productDescribe;

    @ApiModelProperty(value = "商品价格",example = "1")
    private Float price;

    @ApiModelProperty(value = "商品图片")
    private String img;

    @ApiModelProperty(value = "商品分类")
    private String category;

    @ApiModelProperty(value = "发布用户")
    private String releaseUser;

    private User releaseUserPojo;

    @ApiModelProperty(value = "发布时间")
    private Date releaseTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "是否上架")
    private Boolean shelves;

    @ApiModelProperty(value = "商品状态")
    private Integer productState;

    @ApiModelProperty(value = "逻辑删除标记位")
    private Integer isDelete;

    private Category myCategory;

    public String getStringReleaseTime() {
        return new SimpleDateFormat("yyyy-MM-dd").format(this.releaseTime);
    }
}
